package com.e2oto.seller.modules.seller.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.ViewGroup;

import com.e2oto.seller.modules.seller.ui.OrderFragment;
import com.e2oto.seller.modules.seller.ui.PendingFragment;
import com.e2oto.seller.modules.seller.ui.ShopFragment;
import com.e2oto.seller.modules.seller.ui.MineFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ZhangLiQiang on 2017/9/15.
 */

public class MainPageAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;


    public MainPageAdapter(FragmentManager fm) {
        super(fm);

        fragments = new ArrayList<>();
        fragments.add(new PendingFragment());
        fragments.add(new ShopFragment());
        fragments.add(new OrderFragment());
        fragments.add(new MineFragment());
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public void destroyItem(ViewGroup container, int position, Object object) {
        //super.destroyItem(container, position, object);
    }


}
